 //Initialize Select2 Elements


function clearCache(){
	getModal.show({content:'确定清除？',cb_l:function(){return deleteApiCb()}});
}



function deleteApiCb(){
	var pwd =$("#pwd").val();
	if(pwd==''||pwd==null){
		alert("请填写密码");
		return;
	}
	
	var cacheId =$("#cacheId").val();
	var param = {
			pwd:hex_md5(pwd)
	}
	$.ajax({
		url:'/cache/'+cacheId,
		type:'POST',
		data:param
	}).done(function(res){
		if(res.success){
			toast.show('操作成功');
			cancel('bg');
		}else{
			toast.show(res.errorMsg);
			$("#pwd").val('');
		}
	}).fail(function(res){
		toast.show(res.errorMsg);
		$("#pwd").val('');
	})
}


function showPwd(){
	var pwd =$("#pwd").val();
	if(pwd==''||pwd==null){
		show('bg');
	}else{
		clearCache();
	}
	
}